let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let crossProduct = data["crossProduct"];
let dotProduct = data["dotProduct"];
let compareVectorAngles = data["compareVectorAngles"];
let sineOfAngle = data["sineOfAngle"];
let cosineOfAngle = data["cosineOfAngle"];
let closestPoint = data["closestPoint"];
let horizontalIntersection = data["horizontalIntersection"];
let verticalIntersection = data["verticalIntersection"];
let intersection = data["intersection"];
let perpendicular = data["perpendicular"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let geomOut = data["geomOut"];
let operation = data["operation"];
let Segment = data["Segment"];
let SweepEvent = data["SweepEvent"];
let SweepLine = data["SweepLine"];

console.log("13PolygonClipping_sweep-event");


SweepEvent.compare = function (a, b) { const ptCmp = SweepEvent.comparePoints(a.point, b.point); return 0 !== ptCmp ? ptCmp : (a.point !== b.point && a.link(b), a.isLeft !== b.isLeft ? a.isLeft ? 1 : -1 : Segment.compare(a.segment, b.segment)) }, SweepEvent.comparePoints = function (aPt, bPt) { return aPt.x < bPt.x ? -1 : aPt.x > bPt.x ? 1 : aPt.y < bPt.y ? -1 : aPt.y > bPt.y ? 1 : 0 }, utils.extend(SweepEvent.prototype, { link: function (other) { if (other.point === this.point) throw new Error("Tried to link already linked events"); const otherEvents = other.point.events; for (let i = 0, iMax = otherEvents.length; i < iMax; i++) { const evt = otherEvents[i]; this.point.events.push(evt), evt.point = this.point } this.checkForConsuming() }, checkForConsuming: function () { const numEvents = this.point.events.length; for (let i = 0; i < numEvents; i++) { const evt1 = this.point.events[i]; if (void 0 === evt1.segment.consumedBy) for (let j = i + 1; j < numEvents; j++) { const evt2 = this.point.events[j]; void 0 === evt2.consumedBy && evt1.otherSE.point.events === evt2.otherSE.point.events && evt1.segment.consume(evt2.segment) } } }, getAvailableLinkedEvents: function () { const events = []; for (let i = 0, iMax = this.point.events.length; i < iMax; i++) { const evt = this.point.events[i]; evt !== this && !evt.segment.ringOut && evt.segment.isInResult() && events.push(evt) } return events }, getLeftmostComparator: function (baseEvent) { const cache = new Map, fillCache = linkedEvent => { const nextEvent = linkedEvent.otherSE; cache.set(linkedEvent, { sine: sineOfAngle(this.point, baseEvent.point, nextEvent.point), cosine: cosineOfAngle(this.point, baseEvent.point, nextEvent.point) }) }; return (a, b) => { cache.has(a) || fillCache(a), cache.has(b) || fillCache(b); const { sine: asine, cosine: acosine } = cache.get(a), { sine: bsine, cosine: bcosine } = cache.get(b); return asine >= 0 && bsine >= 0 ? acosine < bcosine ? 1 : acosine > bcosine ? -1 : 0 : asine < 0 && bsine < 0 ? acosine < bcosine ? -1 : acosine > bcosine ? 1 : 0 : bsine < asine ? -1 : bsine > asine ? 1 : 0 } } });

return {
  "utils": utils,
  "STUtil": STUtil,
  "Node": Node,
  "SplayTree": SplayTree,
  "isInBbox": isInBbox,
  "getBboxOverlap": getBboxOverlap,
  "cmp": cmp,
  "crossProduct": crossProduct,
  "dotProduct": dotProduct,
  "compareVectorAngles": compareVectorAngles,
  // "length":length,
  "sineOfAngle": sineOfAngle,
  "cosineOfAngle": cosineOfAngle,
  "closestPoint": closestPoint,
  "horizontalIntersection": horizontalIntersection,
  "verticalIntersection": verticalIntersection,
  "intersection": intersection,
  "perpendicular": perpendicular,
  "rounder": rounder,
  "geomIn": geomIn,
  "geomOut": geomOut,
  "operation": operation,
  "Segment": Segment,
  "SweepEvent": SweepEvent,
  "SweepLine": SweepLine
}